﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

// 模拟帧 FE 00 4D 04 49
namespace LRSystem
{
    public class LRRfModuleSetFrequency : ISendPacket
    {
        public UInt32 Frequency { get; set; }  // 1个字节

        private static byte size
        {
            get { return 4; }
        }

        private byte FrequencyPos
        {
            get { return 0; }
        }
 
        public const ushort Type = (ushort)0x004E;

        //public byte[] BuildCmd()                // 形成完整的packet，包括SOF,LEN,CMD,DATA,FCS
        //{
        //    byte[] cmdbuffer = new byte[size];  // 需要将SOF,LEN,CMD,FCS加进去
        //    byte[] a = BitConverter.GetBytes(Frequency);
        //    a.CopyTo(cmdbuffer, 0);
        //    cmdbuffer = ParkingOriginalPacket.BuildOriginalPacket(cmdbuffer, Type);
        //    return cmdbuffer;
        //}

        public override string ToString()
        {
            string s = string.Format("{0,-25} {1,20} {2,25}", "(Field)", "(Hex)", "(Decimal)");
            s += string.Format("\n{0,-25}|{1,20:X4} {2,25:G}", "Type", Type, this.GetType().Name);
            s += string.Format("\n{0,-25}|{1,20:X8} {1,25:G}", "Frequency", Frequency);
            return s;
        }
    }
}